/**
* 版权声明：厦门睿商网络科技有限公司 版权所有 违者必究
* 日    期：2021-01-08
*/
package com.rzico.account.entity;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.rzico.account.model.Attach;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * <pre>
 *   豆讯话费支付数据库对象
 * </pre>
 * @author Rzico Boot
 * @version 1.0
 */
@Data
@JsonIgnoreProperties(value = {"handler"})
@JsonInclude(JsonInclude.Include.NON_NULL)
@Table(name = "mk_phone_payment")
public class PhonePayment {
    @Id
    @ApiModelProperty(value = "" )
    protected Long id;

    @ApiModelProperty(value = "创建日期" )
    protected Date createDate;

    @ApiModelProperty(value = "修改日期" )
    protected Date modifyDate;

    @ApiModelProperty(value = "付款金额" )
    protected java.math.BigDecimal amount;

    @ApiModelProperty(value = "退款金额" )
    protected java.math.BigDecimal refund;

    @ApiModelProperty(value = "手续费" )
    protected java.math.BigDecimal fee;

    @ApiModelProperty(value = "到期时间" )
    protected Date expire;

    @ApiModelProperty(value = "备注" )
    protected String memo;

    @ApiModelProperty(value = "方式 {0:在线支付}" )
    protected Integer method;

    @ApiModelProperty(value = "付款日期" )
    protected Date paymentDate;

    @ApiModelProperty(value = "支付插件" )
    protected String paymentPluginId;

    @ApiModelProperty(value = "付款方式" )
    protected String paymentPluginName;

    @ApiModelProperty(value = "付款单号" )
    protected String sn;

    @ApiModelProperty(value = "状态 {0:等待支付,1:支付成功,3:支付失败,4:等待退款,5:退款完成,6:退款失败}" )
    protected Integer status;

    @ApiModelProperty(value = "类型 {0:付款,1:充值,2.收款}" )
    protected Integer type;

    @ApiModelProperty(value = "付款人(会员表)" )
    protected Long memberId;

    @ApiModelProperty(value = "方向 {0:代付,1:直清,2:代清}" )
    protected Integer way;

    @JsonIgnore
    @ApiModelProperty(value = "是否删除" ,hidden = true )
    protected Boolean deleted;

    @ApiModelProperty(value = "付款凭证号(第三方ID)" )
    protected String tranSn;

    @ApiModelProperty(value = "归属企业" )
    protected Long enterpriseId;

    @ApiModelProperty(value = "订单ID" )
    protected Long orderId;

    @ApiModelProperty(value = "订单号" )
    protected String orderSn;

    @ApiModelProperty(value = "附加数据" )
    protected String attach;

    @JsonIgnore
    @ApiModelProperty(value = "创建者" ,hidden = true )
    protected String createBy;

    @JsonIgnore
    @ApiModelProperty(value = "更新者" ,hidden = true )
    protected String modifyBy;


    public Attach decodeAttach() {
        if (getAttach()!=null) {
            return JSON.parseObject(getAttach(),Attach.class);
        } else {
            return null;
        }
    }


}
